﻿var fenghuolunHTML = "<div class='fenghuolun'><div class='fenghuolun_loading'></div></div>";
var ie6;
var scrollSize = 0;
$.ajaxSetup({ cache: false });
var defaultDate = new Date(2009, 8, 9);
var errRetry_N = 0;
$(function () {

    $(".input_text").focus(function () { $(this).addClass("input_text_on") }).blur(function () { $(this).removeClass("input_text_on") });
    chkvalue_4hide();

    $("<div id='test_outer' style='width:100px;height:100px;overflow:auto;'><div id='test_inner' style='width:200px;height:200px'></div></div>").appendTo("body");
    scrollSize = 100 - $("#test_outer")[0].clientWidth;
    $("#test_outer").remove();
});
function fenghuolun_open(w_, color_) {
    var color = "fff";
    if (color_) color = color_;
    fenghuolun_open_(w_, 0.9, true, color)

}
function fenghuolun_open_(wA_, bgopacity, needLoading, color_) {
    var color = "fff";
    if (color_) color = color_;

    var wA = $(wA_);
    wA.each(function () {
        var w = $(this), cover;
        if (w.is(":hidden") || w.width()==0 || w.height()==0) return;
        if (w.has("[fenghuolunID]") && w.attr("fenghuolunID") != "" && $("#" + w.attr("fenghuolunID")).length > 0) cover = $("#" + w.attr("fenghuolunID"));
        else {
            var newID = "fenghuolun" + rand(999999);
            w.attr("fenghuolunID", newID);
            cover = $(fenghuolunHTML).attr("id", newID).appendTo("body");
            if (bgopacity == 0) cover.css({ backgroundColor: "initial" });
            else cover.css({ opacity: bgopacity, backgroundColor: "#" + color })
        }
        //
        //if (w.css("zIndex") != "auto") cover.css({ zIndex: accAdd(w.css("zIndex") * 1, 1) });
        //else {
        //    var maybe_index = w.parents("[data-zindex]");
        //    if (maybe_index.length > 0 && maybe_index.css("zIndex") != "auto") cover.css({ zIndex: accAdd(maybe_index.css("zIndex") * 1, 1) });
        //}
        cover.css({ left: w.offset().left, top: w.offset().top, width: w.width(), height: w.height(),zIndex:accAdd( getRealZindex(w),1) }).fadeIn("fast", function () {
            if (needLoading) $(".fenghuolun_loading", cover).show();
        });
    })
}
function fenghuolun_close(w_) {
    var w = $(w_), cover = $("#" + w.attr("fenghuolunID"));
    $(".fenghuolun_loading", cover).hide();
    cover.stop().fadeOut("fast", function () {
        cover.remove();
        w.removeAttr("fenghuolunID");
    });
}
function fenghuolun_closeALL() {
    $(".fenghuolun_loading").hide();
    $(".fenghuolun").stop().fadeOut("fast", function () {
        $(this).remove();
        $("[fenghuolunID]").removeAttr("fenghuolunID");
    });
}
function getRealZindex(w) {
    var zIndex = "";
    while ((zIndex == "auto" || zIndex == "" || zIndex==0) && w.not("body")) {
        zIndex = w.css("zIndex");
        //zIndex = w[0].style.zIndex;
        w = w.parent();
    }
    if (zIndex == "auto") zIndex = 1;
    return zIndex;
}
//根据要检测的内容，判断是否要隐藏
function chkvalue_4hide() {
    $("[chkvalue]").each(function () {
        var me = $(this);
        if (me.find(me.attr("valuedom")).html() == me.attr("chkvalue")) me.hide();
    })
}
function ie6_open() {
    ie6.show();
}


jQuery.fn.outerHTML = function (s) {
    //return (s) ? this.before(s).remove() : jQuery("&lt;p&gt;").append(this.eq(0).clone()).html();
    return (s) ? this.before(s).remove() : jQuery("<p>").append(this.eq(0).clone()).html();
}
function cleanWhitespace(element) {
    //如果不提供参数，则处理整个HTML文档
    element = element || document;
    //使用第一个子节点作为开始指针
    var cur = element.firstChild;
    //临时变量用来保存当前节点的下个节点
    var tmp;
    //一直到没有子节点为止
    while (cur != null) {
        //保存当前节点的下个节点
        tmp = cur.nextSibling
        //如果节点为文本节点，应且包含空格
        if (cur.nodeType == 3 && !/\S/.test(cur.nodeValue)) {
            //删除这个文本节点
            element.removeChild(cur);
            //否则，它就是一个元素        
        } else if (cur.nodeType == 1) {
            //递归整个文档
            cleanWhitespace(cur);
        }
        cur = tmp; //遍历子节点
    }
}

//处理input默认值
function input_title() {
    $("[typetext=password_text]").hide();
    $("input[title]").val(function () {
        if ($(this).val() == null || $(this).val() == "") return $(this).attr("title");
        else return $(this).val();
    })
    .focus(function () {
        var me = $(this);
        if (me.is("[typepassword]")) {
            me.hide();
            $("#" + me.attr("typepassword")).show().focus();
        }
        else if ($(this).val() == $(this).attr("title")) $(this).val("");
    })
    .blur(function () {
        var me = $(this);
        if (me.val() == "") {
            if (me.is("[typetext]")) {
                me.hide();
                var inputtext = $("#" + me.attr("typetext"));
                inputtext.show().val(inputtext.attr("title"));
            }
            else me.val(me.attr("title"));
        }
    })

    ;
}
function input_title_clear() {
    $("input[title]").val(function () {
        if ($(this).attr("title") == $(this).val()) return "";
        else return $(this).val();
    });
}
function input_title_clear(w) {
    $("input[title]", w).val(function () {
        if ($(this).attr("title") == $(this).val()) return "";
        else return $(this).val();
    });
}


function convertArray(o, w) { //主要是推荐这个函数。它将jquery系列化后的值转为name:value的形式。 
    //    var v = {};
    //    for (var i in o) {
    //        if (typeof (v[o[i].name]) == 'undefined') v[o[i].name] = o[i].value;
    //        else v[o[i].name] += "," + o[i].value;
    //    }
    //    return v;
    if (w == null) w = $("body");
    var v = {};
    for (var i in o) {
        var me = $("[name=" + o[i].name + "]", w);
        var meRealName = me.attr("name");
        if (me.attr("sn") != null && me.attr("sn") != "") meRealName = me.attr("sn");
        if (typeof (v[meRealName]) == 'undefined') v[meRealName] = o[i].value;
        else v[meRealName] += "," + o[i].value;
    }
    return v;
}

//格式化json
function reqString(v) {
    if (v == null) return "";
    else return v;
}
function reqInt(v) {
    if (v == null) return 0;
    else return v;
}
//操作字符串
function bukong(html_, v) {
    if (v != null && v != "") return html_ + v;
    else return "";
}
function bukong_(v, html_) {
    if (v != null && v != "") return v + html_;
    else return "";
}
function kong(html_, v) {
    if (reqString(v) == "") return html_;
    else return reqString(v);
}
function str2Date(str) {
    str = str.replace(/-/g, "/");
    var n = str.length - str.replace(/\//g, "").length;
    if (n == 0) str += "/1/1";
    else if (n == 1) str += "/1";
    return new Date(str);
}


//除法函数，用来得到精确的除法结果
//说明：javascript的除法结果会有误差，在两个浮点数相除的时候会比较明显。这个函数返回较为精确的除法结果。
//调用：accDiv(arg1,arg2)
//返回值：arg1除以arg2的精确结果
function accDiv(arg1, arg2) {
    var t1 = 0, t2 = 0, r1, r2;
    try { t1 = arg1.toString().split(".")[1].length } catch (e) { }
    try { t2 = arg2.toString().split(".")[1].length } catch (e) { }
    with (Math) {
        r1 = Number(arg1.toString().replace(".", ""))
        r2 = Number(arg2.toString().replace(".", ""))
        return (r1 / r2) * pow(10, t2 - t1);
    }
}
//给Number类型增加一个div方法，调用起来更加方便。
Number.prototype.div = function (arg) {
    return accDiv(this, arg);
}


//乘法函数，用来得到精确的乘法结果
//说明：javascript的乘法结果会有误差，在两个浮点数相乘的时候会比较明显。这个函数返回较为精确的乘法结果。
//调用：accMul(arg1,arg2)
//返回值：arg1乘以arg2的精确结果
function accMul(arg1, arg2) {
    var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
    try { m += s1.split(".")[1].length } catch (e) { }
    try { m += s2.split(".")[1].length } catch (e) { }
    return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
}

//给Number类型增加一个mul方法，调用起来更加方便。
Number.prototype.mul = function (arg) {
    return accMul(arg, this);
}


//加法函数，用来得到精确的加法结果
//说明：javascript的加法结果会有误差，在两个浮点数相加的时候会比较明显。这个函数返回较为精确的加法结果。
//调用：accAdd(arg1,arg2)
//返回值：arg1加上arg2的精确结果
function accAdd(arg1, arg2) {
    var r1, r2, m;
    try { r1 = arg1.toString().split(".")[1].length } catch (e) { r1 = 0 }
    try { r2 = arg2.toString().split(".")[1].length } catch (e) { r2 = 0 }
    m = Math.pow(10, Math.max(r1, r2))
    return (arg1 * m + arg2 * m) / m
}

//给Number类型增加一个add方法，调用起来更加方便。
Number.prototype.add = function (arg) {
    return accAdd(arg, this);
}
function rand(n) { return Math.floor(Math.random() * n + 1) }

function chk_inA(A_, v_) {
    var int_return = -1;
    for (var i = 0; i < A_.length; i++) {
        if (A_[i] == v_) int_return = i;
    }
    return int_return;
}



function intMinMax(v_, POPcolor_min, POPcolor_max) {
    var v = v_;
    if (v_ < POPcolor_min) v = POPcolor_min;
    else if (v_ > POPcolor_max) v = POPcolor_max;
    return v;
}

String.prototype.Print1 = function () {
    return new Date(parseInt(this.replace("/Date(", "").replace(")/", ""), 10));
};
function JsonDate(v_) {
    return new Date(parseInt(v_.substr(6)));
}
Date.prototype.format = function (format) {
    var o = {
        "M+": this.getMonth() + 1, //month 
        "d+": this.getDate(), //day 
        "h+": this.getHours(), //hour 
        "m+": this.getMinutes(), //minute 
        "s+": this.getSeconds(), //second 
        "q+": Math.floor((this.getMonth() + 3) / 3), //quarter 
        "S": this.getMilliseconds() //millisecond 
    };
    if (/(y+)/.test(format)) {
        format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    }
    for (var k in o) {
        if (new RegExp("(" + k + ")").test(format)) {
            format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
        }
    }
    return format;
};
//#region 调试执行错误
function degubError(str, func, funcEnd) {
    if (errRetry_N < 3) {

        errRetry_N++;
        if (func != "") eval(func);
    }
    else {
        if (funcEnd != "") eval(funcEnd);
        if (str != "") alert(str);
        errRetry_N = 0;
    }
}
//#endregion


function Rand4A(val_) {
    var valA_ = val_.split("|");
    var i_ = Math.floor(Math.random() * (valA_.length));
    //alert(i_+" "+valA_[i_]);
    return valA_[i_];
}





function IsEmail(v_) {
    var pattern = /^[a-zA-Z0-9_\-]{1,}@[a-zA-Z0-9_\-]{1,}\.[a-zA-Z0-9_\-.]{1,}$/;
    if (v_ && v_ != "") return pattern.exec(v_);
    else return true;
}
function IsMobile(v_) {
    var reg0 = /^13\d{5,9}$/;
    var reg1 = /^153\d{4,8}$/;
    var reg2 = /^159\d{4,8}$/;
    var reg3 = /^0\d{10,11}$/;
    if (v_ && v_ != "") return (reg0.exec(v_) || reg1.exec(v_) || reg2.exec(v_) || reg3.exec(v_));
    else return true;
}

function PlayAudio(w_) {
    if (!-[1, ]) {
        var w_id = $(w_).attr("id").replace("audio", "");
        if (w_id.indexOf("embed") == -1) w_id = "embed" + w_id;
        var _embed = $("#" + w_id);
        //alert("w_id=" + w_id + ",length=" + _embed.length);
        //if (_embed.length > 0) try { _embed[0].play(); } catch (err) { }
    }
    else {
        try { w_.play(); } catch (err) { }
    }
}

function bindEvent_href(w) {
    var $box = $("body");
    if (w&&w.length>0) $box = w;
    $box.find("[href-list]").each(function () {
        href_list_click(this);
    })
    $box.find("[href-right]").each(function () {
        href_right_click(this);
    })
    $box.find("[href-info]").each(function () {
        href_info_click(this);
    })
    return false;
}
function href_list_click(w_){
    var me = $(w_);
    if (me.data("events") == undefined || me.data("events")[onclick] == null) {
        if (me.length > 0) me.fastClick(function () {
            parent.popover_close();
            parent.close_adminRight();
            var _AbsoluteUrl=getAbsoluteUrl(me.attr("href-list"));
            top.showMenu(_AbsoluteUrl.toLowerCase());
            parent.open_frameList(_AbsoluteUrl, me.is("[target=_blank]"), me.attr("title")); return false;
            return false;
        })
    }
}
function href_right_click(w_) {
    var me = $(w_);
    if (me.data("events") == undefined || me.data("events")[onclick] == null) {
        if (me.length > 0) me.fastClick(function () {
            parent.popover_close();
            var right_Title =me.is("[title]")? me.attr("title"):"", right_Href = me.attr("href-right"), right_Action =me.is("[data-action]")? me.attr("data-action"):me.html();

            //查找重定向元素
            var row_Key = me.is("[datakey]") ? me : me.parents("[datakey]");
            if (row_Key && me.is("[data-rowcontrol-basic]")) {
                //重写Title
                var row_Title = row_Key.find("[data-row-title]");
                if (row_Title.length > 0) right_Title =right_Action+" "+ row_Title.attr("data-row-title");
                //重写href-right
                var row_Right_Href = row_Key.find("[data-row-href-right]");
                if (row_Right_Href.length > 0) {
                    right_Href = row_Right_Href.attr("data-row-href-right");
                    right_Title = row_Title.attr("data-row-title");
                }
                //重写action-right
                var row_Right_Action = row_Key.find("[data-row-action-right]");
                if (row_Right_Action.length > 0) right_Action = row_Right_Action.attr("data-row-action-right");
            }
            //if (right_Title == "" && me.find("data-row-title").length > 0) right_Title = me.find("[data-row-title]").attr("data-row-title");
            if (right_Title == "") right_Title = right_Action + " " + window.title;

            //var meTitle;
            //if (me.is("[title]") && me.attr("title") != "") meTitle = me.attr("title");
            //else {
            //    var thisAction = me.html();
            //    if (thisAction == "") thisAction = me.attr("data-action");

            //    if (me.is("[datakey]")) meTitle = me.find("[data-row-title]").attr("data-row-title");
            //    else meTitle = me.find("[data-row-title]").attr("data-row-title");
            //    var thisName = "";
            //    if (!thisName || thisName == "") thisName = window.title;
            //    meTitle = thisAction + " " + thisName;
            //    //if (me.parents("tr").find("[data-row-title]").attr("data-row-title") != "") meTitle = me.html() + me.parents("tr").find("[data-row-title]").attr("data-row-title");
            //    //else meTitle = me.html() + document.title
            //}
            //parent.popover_close();
            //var hrefRight = me.attr("href-right");
            //if (me.is("[data-rowcontrol-basic]") && me.parents("tr").find("[data-row-href-right]").length > 0) hrefRight = me.parents("tr").find("[data-row-href-right]").attr("data-row-href-right");//重定向 编辑按钮
            parent.open_frameRight(getAbsoluteUrl(right_Href), "" + right_Title); return false;
            return false;
        })
    }
}
function href_info_click(w_) {
    var me = $(w_);
    if (me.data("events") == undefined || me.data("events")[onclick] == null) {
        if (me.length > 0) me.fastClick(function () {
            var info_Title = me.attr("title"), info_Href = me.attr("href-info");
            //查找重定向元素
            var row_Key = me.is("[datakey]") ? me : me.parents("[datakey]");
            if (row_Key && me.is("[data-rowcontrol-basic]")) {
                var row_Title = row_Key.find("[data-row-title]");
                if (row_Title.length > 0) info_Title = row_Title.attr("data-row-title");
                var row_Info_Href = row_Key.find("[data-row-href-info]");
                if (row_Info_Href.length > 0) info_Href = row_Info_Href.attr("data-row-href-info");
                else {
                    var row_Right_Href = row_Key.find("[data-row-href-right]");
                    if (row_Right_Href.length > 0) {
                        parent.open_frameRight(getAbsoluteUrl(row_Right_Href.attr("data-row-href-right")), "" + info_Title); return false;
                    }
                }
            }
            
            
            //if (me.is("[title]") && me.attr("title") != "") info_Title = me.attr("title");
            //else {
            //    if (me.is("[datakey]")) info_Title = me.find("[data-row-title]").attr("data-row-title");
            //    else if (me.is("[data-row-title]")) info_Title = me.find("[data-row-title]").attr("data-row-title");
            //    else info_Title = me.parents("tr").find("[data-row-title]").attr("data-row-title");
            //    //meTitle = me.parents("[datakey]").find("[data-row-title]").attr("data-row-title");
            //    //if ($("#ListShowUl").length > 0) meTitle = me.find("[data-row-title]").attr("data-row-title");
            //}
            ////parent.open_frameRight(window.location.pathname.substring(0, window.location.pathname.lastIndexOf("/") * 1 + 1) + me.attr("href-info"), "" + meTitle);
            //parent.close_adminRight();
            //var info_Href = me.attr("href-info");
            ////if (me.is("[data-rowcontrol-basic]") && me.parents("tr").find("[data-row-href-info]").length > 0) hrefInfo = me.parents("tr").find("[data-row-href-info]").attr("data-row-href-info");//重定向 info按钮
            ////可能存在的 重新info链接的元素
            //if (me.is("[data-rowcontrol-basic]")) {
            //    var mybeReBuildHref = me.parents("[datakey]").find("[data-row-href-info]");
            //    if (mybeReBuildHref.length > 0) info_Href = mybeReBuildHref.attr("data-row-href-info");
            //}
            parent.open_popover(me, getAbsoluteUrl(info_Href), "" + info_Title);
            return false;
        })
    }
}
function getAbsoluteUrl(strurl) {
    var a = document.createElement('A');
    a.href = strurl;  // 设置相对路径给Image, 此时会发送出请求
    strurl = a.href;  // 此时相对路径已经变成绝对路径
    return strurl;
}
var PCNo = {
    "provinces": [{ "id": 11, "name": "北京", "citys": [{ "1": "东城区" }, { "2": "西城区" }, { "3": "崇文区" }, { "4": "宣武区" }, { "5": "朝阳区" }, { "6": "丰台区" }, { "7": "石景山区" }, { "8": "海淀区" }, { "9": "门头沟区" }, { "11": "房山区" }, { "12": "通州区" }, { "13": "顺义区" }, { "14": "昌平区" }, { "15": "大兴区" }, { "16": "怀柔区" }, { "17": "平谷区" }, { "28": "密云县" }, { "29": "延庆县" }] },
    { "id": 12, "name": "天津", "citys": [{ "1": "和平区" }, { "2": "河东区" }, { "3": "河西区" }, { "4": "南开区" }, { "5": "河北区" }, { "6": "红桥区" }, { "7": "塘沽区" }, { "8": "汉沽区" }, { "9": "大港区" }, { "10": "东丽区" }, { "11": "西青区" }, { "12": "津南区" }, { "13": "北辰区" }, { "14": "武清区" }, { "15": "宝坻区" }, { "21": "宁河县" }, { "23": "静海县" }, { "25": "蓟县" }] },
    { "id": 13, "name": "河北", "citys": [{ "1": "石家庄" }, { "2": "唐山" }, { "3": "秦皇岛" }, { "4": "邯郸" }, { "5": "邢台" }, { "6": "保定" }, { "7": "张家口" }, { "8": "承德" }, { "9": "沧州" }, { "10": "廊坊" }, { "11": "衡水" }] },
    { "id": 14, "name": "山西", "citys": [{ "1": "太原" }, { "2": "大同" }, { "3": "阳泉" }, { "4": "长治" }, { "5": "晋城" }, { "6": "朔州" }, { "7": "晋中" }, { "8": "运城" }, { "9": "忻州" }, { "10": "临汾" }, { "23": "吕梁" }] },
    { "id": 15, "name": "内蒙古", "citys": [{ "1": "呼和浩特" }, { "2": "包头" }, { "3": "乌海" }, { "4": "赤峰" }, { "5": "通辽" }, { "6": "鄂尔多斯" }, { "7": "呼伦贝尔" }, { "22": "兴安盟" }, { "25": "锡林郭勒盟" }, { "26": "乌兰察布盟" }, { "28": "巴彦淖尔盟" }, { "29": "阿拉善盟" }] },
    { "id": 21, "name": "辽宁", "citys": [{ "1": "沈阳" }, { "2": "大连" }, { "3": "鞍山" }, { "4": "抚顺" }, { "5": "本溪" }, { "6": "丹东" }, { "7": "锦州" }, { "8": "营口" }, { "9": "阜新" }, { "10": "辽阳" }, { "11": "盘锦" }, { "12": "铁岭" }, { "13": "朝阳" }, { "14": "葫芦岛" }] },
    { "id": 22, "name": "吉林", "citys": [{ "1": "长春" }, { "2": "吉林" }, { "3": "四平" }, { "4": "辽源" }, { "5": "通化" }, { "6": "白山" }, { "7": "松原" }, { "8": "白城" }, { "24": "延边朝鲜族自治州" }] },
    { "id": 23, "name": "黑龙江", "citys": [{ "1": "哈尔滨" }, { "2": "齐齐哈尔" }, { "3": "鸡西" }, { "4": "鹤岗" }, { "5": "双鸭山" }, { "6": "大庆" }, { "7": "伊春" }, { "8": "佳木斯" }, { "9": "七台河" }, { "10": "牡丹江" }, { "11": "黑河" }, { "12": "绥化" }, { "27": "大兴安岭" }] },
    { "id": 31, "name": "上海", "citys": [{ "1": "黄浦区" }, { "3": "卢湾区" }, { "4": "徐汇区" }, { "5": "长宁区" }, { "6": "静安区" }, { "7": "普陀区" }, { "8": "闸北区" }, { "9": "虹口区" }, { "10": "杨浦区" }, { "12": "闵行区" }, { "13": "宝山区" }, { "14": "嘉定区" }, { "15": "浦东新区" }, { "16": "金山区" }, { "17": "松江区" }, { "18": "青浦区" }, { "19": "南汇区" }, { "20": "奉贤区" }, { "30": "崇明县" }] },
    { "id": 32, "name": "江苏", "citys": [{ "1": "南京" }, { "2": "无锡" }, { "3": "徐州" }, { "4": "常州" }, { "5": "苏州" }, { "6": "南通" }, { "7": "连云港" }, { "8": "淮安" }, { "9": "盐城" }, { "10": "扬州" }, { "11": "镇江" }, { "12": "泰州" }, { "13": "宿迁" }] },
    { "id": 33, "name": "浙江", "citys": [{ "1": "杭州" }, { "2": "宁波" }, { "3": "温州" }, { "4": "嘉兴" }, { "5": "湖州" }, { "6": "绍兴" }, { "7": "金华" }, { "8": "衢州" }, { "9": "舟山" }, { "10": "台州" }, { "11": "丽水" }] },
    { "id": 34, "name": "安徽", "citys": [{ "1": "合肥" }, { "2": "芜湖" }, { "3": "蚌埠" }, { "4": "淮南" }, { "5": "马鞍山" }, { "6": "淮北" }, { "7": "铜陵" }, { "8": "安庆" }, { "10": "黄山" }, { "11": "滁州" }, { "12": "阜阳" }, { "13": "宿州" }, { "14": "巢湖" }, { "15": "六安" }, { "16": "亳州" }, { "17": "池州" }, { "18": "宣城" }] },
    { "id": 35, "name": "福建", "citys": [{ "1": "福州" }, { "2": "厦门" }, { "3": "莆田" }, { "4": "三明" }, { "5": "泉州" }, { "6": "漳州" }, { "7": "南平" }, { "8": "龙岩" }, { "9": "宁德" }] },
    { "id": 36, "name": "江西", "citys": [{ "1": "南昌" }, { "2": "景德镇" }, { "3": "萍乡" }, { "4": "九江" }, { "5": "新余" }, { "6": "鹰潭" }, { "7": "赣州" }, { "8": "吉安" }, { "9": "宜春" }, { "10": "抚州" }, { "11": "上饶" }] },
    { "id": 37, "name": "山东", "citys": [{ "1": "济南" }, { "2": "青岛" }, { "3": "淄博" }, { "4": "枣庄" }, { "5": "东营" }, { "6": "烟台" }, { "7": "潍坊" }, { "8": "济宁" }, { "9": "泰安" }, { "10": "威海" }, { "11": "日照" }, { "12": "莱芜" }, { "13": "临沂" }, { "14": "德州" }, { "15": "聊城" }, { "16": "滨州" }, { "17": "菏泽" }] },
    { "id": 41, "name": "河南", "citys": [{ "1": "郑州" }, { "2": "开封" }, { "3": "洛阳" }, { "4": "平顶山" }, { "5": "安阳" }, { "6": "鹤壁" }, { "7": "新乡" }, { "8": "焦作" }, { "9": "濮阳" }, { "10": "许昌" }, { "11": "漯河" }, { "12": "三门峡" }, { "13": "南阳" }, { "14": "商丘" }, { "15": "信阳" }, { "16": "周口" }, { "17": "驻马店" }] },
    { "id": 42, "name": "湖北", "citys": [{ "1": "武汉" }, { "2": "黄石" }, { "3": "十堰" }, { "5": "宜昌" }, { "6": "襄樊" }, { "7": "鄂州" }, { "8": "荆门" }, { "9": "孝感" }, { "10": "荆州" }, { "11": "黄冈" }, { "12": "咸宁" }, { "13": "随州" }, { "28": "恩施土家族苗族自治州" }] },
    { "id": 43, "name": "湖南", "citys": [{ "1": "长沙" }, { "2": "株洲" }, { "3": "湘潭" }, { "4": "衡阳" }, { "5": "邵阳" }, { "6": "岳阳" }, { "7": "常德" }, { "8": "张家界" }, { "9": "益阳" }, { "10": "郴州" }, { "11": "永州" }, { "12": "怀化" }, { "13": "娄底" }, { "31": "湘西土家族苗族自治州" }] },
    { "id": 44, "name": "广东", "citys": [{ "1": "广州" }, { "2": "韶关" }, { "3": "深圳" }, { "4": "珠海" }, { "5": "汕头" }, { "6": "佛山" }, { "7": "江门" }, { "8": "湛江" }, { "9": "茂名" }, { "12": "肇庆" }, { "13": "惠州" }, { "14": "梅州" }, { "15": "汕尾" }, { "16": "河源" }, { "17": "阳江" }, { "18": "清远" }, { "19": "东莞" }, { "20": "中山" }, { "51": "潮州" }, { "52": "揭阳" }, { "53": "云浮" }] },
    { "id": 45, "name": "广西", "citys": [{ "1": "南宁" }, { "2": "柳州" }, { "3": "桂林" }, { "4": "梧州" }, { "5": "北海" }, { "6": "防城港" }, { "7": "钦州" }, { "8": "贵港" }, { "9": "玉林" }, { "10": "百色" }, { "11": "贺州" }, { "12": "河池" }, { "21": "南宁" }, { "22": "柳州" }] },
    { "id": 46, "name": "海南", "citys": [{ "1": "海口" }, { "2": "三亚" }, { "90": "其他" }] },
    { "id": 50, "name": "重庆", "citys": [{ "1": "万州区" }, { "2": "涪陵区" }, { "3": "渝中区" }, { "4": "大渡口区" }, { "5": "江北区" }, { "6": "沙坪坝区" }, { "7": "九龙坡区" }, { "8": "南岸区" }, { "9": "北碚区" }, { "10": "万盛区" }, { "11": "双桥区" }, { "12": "渝北区" }, { "13": "巴南区" }, { "14": "黔江区" }, { "15": "长寿区" }, { "22": "綦江县" }, { "23": "潼南县" }, { "24": "铜梁县" }, { "25": "大足县" }, { "26": "荣昌县" }, { "27": "璧山县" }, { "28": "梁平县" }, { "29": "城口县" }, { "30": "丰都县" }, { "31": "垫江县" }, { "32": "武隆县" }, { "33": "忠县" }, { "34": "开县" }, { "35": "云阳县" }, { "36": "奉节县" }, { "37": "巫山县" }, { "38": "巫溪县" }, { "40": "石柱土家族自治县" }, { "41": "秀山土家族苗族自治县" }, { "42": "酉阳土家族苗族自治县" }, { "43": "彭水苗族土家族自治县" }, { "81": "江津市" }, { "82": "合川市" }, { "83": "永川区" }, { "84": "南川市" }] },
    { "id": 51, "name": "四川", "citys": [{ "1": "成都" }, { "3": "自贡" }, { "4": "攀枝花" }, { "5": "泸州" }, { "6": "德阳" }, { "7": "绵阳" }, { "8": "广元" }, { "9": "遂宁" }, { "10": "内江" }, { "11": "乐山" }, { "13": "南充" }, { "14": "眉山" }, { "15": "宜宾" }, { "16": "广安" }, { "17": "达州" }, { "18": "雅安" }, { "19": "巴中" }, { "20": "资阳" }, { "32": "阿坝" }, { "33": "甘孜" }, { "34": "凉山" }] },
    { "id": 52, "name": "贵州", "citys": [{ "1": "贵阳" }, { "2": "六盘水" }, { "3": "遵义" }, { "4": "安顺" }, { "22": "铜仁" }, { "23": "黔西南" }, { "24": "毕节" }, { "26": "黔东南" }, { "27": "黔南" }] },
    { "id": 53, "name": "云南", "citys": [{ "1": "昆明" }, { "3": "曲靖" }, { "4": "玉溪" }, { "5": "保山" }, { "6": "昭通" }, { "23": "楚雄" }, { "25": "红河" }, { "26": "文山" }, { "27": "思茅" }, { "28": "西双版纳" }, { "29": "大理" }, { "31": "德宏" }, { "32": "丽江" }, { "33": "怒江" }, { "34": "迪庆" }, { "35": "临沧" }] },
    { "id": 54, "name": "西藏", "citys": [{ "1": "拉萨" }, { "21": "昌都" }, { "22": "山南" }, { "23": "日喀则" }, { "24": "那曲" }, { "25": "阿里" }, { "26": "林芝" }] },
    { "id": 61, "name": "陕西", "citys": [{ "1": "西安" }, { "2": "铜川" }, { "3": "宝鸡" }, { "4": "咸阳" }, { "5": "渭南" }, { "6": "延安" }, { "7": "汉中" }, { "8": "榆林" }, { "9": "安康" }, { "10": "商洛" }] },
    { "id": 62, "name": "甘肃", "citys": [{ "1": "兰州" }, { "2": "嘉峪关" }, { "3": "金昌" }, { "4": "白银" }, { "5": "天水" }, { "6": "武威" }, { "7": "张掖" }, { "8": "平凉" }, { "9": "酒泉" }, { "10": "庆阳" }, { "24": "定西" }, { "26": "陇南" }, { "29": "临夏" }, { "30": "甘南" }] },
    { "id": 63, "name": "青海", "citys": [{ "1": "西宁" }, { "21": "海东" }, { "22": "海北" }, { "23": "黄南" }, { "25": "海南" }, { "26": "果洛" }, { "27": "玉树" }, { "28": "海西" }] },
    { "id": 64, "name": "宁夏", "citys": [{ "1": "银川" }, { "2": "石嘴山" }, { "3": "吴忠" }, { "4": "固原" }] },
    { "id": 65, "name": "新疆", "citys": [{ "1": "乌鲁木齐" }, { "2": "克拉玛依" }, { "21": "吐鲁番" }, { "22": "哈密" }, { "23": "昌吉" }, { "27": "博尔塔拉" }, { "28": "巴音郭楞" }, { "29": "阿克苏" }, { "30": "克孜勒苏" }, { "31": "喀什" }, { "32": "和田" }, { "40": "伊犁" }, { "42": "塔城" }, { "43": "阿勒泰" }] },
    { "id": 71, "name": "台湾", "citys": [{ "1": "台北" }, { "2": "高雄" }, { "90": "其他" }] },
    { "id": 81, "name": "香港", "citys": [{ "1": "香港" }] },
    { "id": 82, "name": "澳门", "citys": [{ "1": "澳门" }] },
    { "id": 100, "name": "其他", "citys": [] },
    { "id": 400, "name": "海外", "citys": [{ "1": "美国" }, { "2": "英国" }, { "3": "法国" }, { "4": "俄罗斯" }, { "5": "加拿大" }, { "6": "巴西" }, { "7": "澳大利亚" }, { "8": "印尼" }, { "9": "泰国" }, { "10": "马来西亚" }, { "11": "新加坡" }, { "12": "菲律宾" }, { "13": "越南" }, { "14": "印度" }, { "15": "日本" }, { "16": "其他" }] }]
}
function Get_CityNo(v_) {
    for (var i = 0; i < PCNo.provinces.length; i++) {
        for (var t = 0; t < PCNo.provinces[i].citys.length; t++) {
            var thisCity = PCNo.provinces[i].citys[t];
            var thisCity_No;
            for (p in thisCity) {
                if (thisCity[p]) { thisCity_No = p; break; }
            }
            if (v_.replace("市", "") == thisCity[thisCity_No]) return thisCity_No;
        }
    }
    return 0;
}
function Get_ProvinceNo(v_) {
    for (var i = 0; i < PCNo.provinces.length; i++) {
        if (v_.replace("省", "") == PCNo.provinces[i].name) return PCNo.provinces[i].id;
    }
    return 0;
}